package cn.eonshine.cuba.inf.modular.basic.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.eonshine.base.core.base.controller.BaseController;
import cn.eonshine.cuba.inf.common.http.Message;
import cn.eonshine.cuba.inf.modular.basic.service.IOilService;

/**
 * 控制器
 *
 * @author fengshuonan
 * @Date 2018-07-28 16:19:46
 */
@RestController
@RequestMapping("/oil")
public class OilController extends BaseController {

	@Autowired
	private IOilService oilService;

    @Value("${data.isUpdate:0}")
    private int isUpdate;
	
	@RequestMapping(value = "/list")
	public Message list(@RequestBody Message message) {
		return oilService.queryDataList(message);
	}

	@RequestMapping(value = "/delete")
	public Object delete(@RequestBody Message message) {
		return oilService.deleteData(message);
	}

	@RequestMapping(value = "/update")
	public Message update(@RequestBody Message message) {
		return oilService.changeLsmsUpdate(message, isUpdate);
	}

}
